cr_0 = 18*10^3*t_hl;
cr_0(2000:end) = 0;
cr_1 = 18*10^3*(t_hl-0.02);
cr_1(1:2000) = 0;
cr_1(4000:end) = 0;
cr_2 = 18*10^3*(t_hl-0.04);
cr_2(1:4000) = 0;
cr_2(6000:end) = 0;
cr_3 = 18*10^3*(t_hl-0.06);
cr_3(1:6000) = 0;
cr_3(8000:end) = 0;
cr_4 = 18*10^3*(t_hl-0.08);
cr_4(1:8000) = 0;
cr_4(10000:end) = 0;
cr_5 = 18*10^3*(t_hl-0.10);
cr_5(1:10000) = 0;
cr_5(12000:end) = 0;
cr_6 = 18*10^3*(t_hl-0.12);
cr_6(1:12000) = 0;
cr_6(14000:end) = 0;
cr_7 = 18*10^3*(t_hl-0.14);
cr_7(1:14000) = 0;
cr_7(16000:end) = 0;
cr_8 = 18*10^3*(t_hl-0.16);
cr_8(1:16000) = 0;
cr_8(18000:end) = 0;
cr_9 = 18*10^3*(t_hl-0.18);
cr_9(1:18000) = 0;
cr_9(20000:end) = 0;
cr_10 = 18*10^3*(t_hl-0.20);
cr_10(1:20000) = 0;
cr_10(22000:end) = 0;
cr_11 = 18*10^3*(t_hl-0.22);
cr_11(1:22000) = 0;
cr_11(24000:end) = 0;
cr_12 = 18*10^3*(t_hl-0.24);
cr_12(1:24000) = 0;
cr_12(26000:end) = 0;
cr_13 = 18*10^3*(t_hl-0.26);
cr_13(1:26000) = 0;
cr_13(28000:end) = 0;
cr_14 = 18*10^3*(t_hl-0.28);
cr_14(1:28000) = 0;
cr_14(30000:end) = 0;
cr_15 = 18*10^3*(t_hl-0.30);
cr_15(1:30000) = 0;
cr_15(32000:end) = 0;
cr_16 = 18*10^3*(t_hl-0.32);
cr_16(1:32000) = 0;
cr_16(34000:end) = 0;
cr_17 = 18*10^3*(t_hl-0.34);
cr_17(1:34000) = 0;
cr_17(36000:end) = 0;
cr_18 = 18*10^3*(t_hl-0.36);
cr_18(1:36000) = 0;
cr_18(38000:end) = 0;
cr_19 = 18*10^3*(t_hl-0.38);
cr_19(1:38000) = 0;
cr_19(40000:end) = 0;
cr_20 = 18*10^3*(t_hl-0.40);
cr_20(1:40000) = 0;
cr_20(42000:end) = 0;
cr_21 = 18*10^3*(t_hl-0.42);
cr_21(1:42000) = 0;
cr_21(44000:end) = 0;
cr_22 = 18*10^3*(t_hl-0.44);
cr_22(1:44000) = 0;
cr_22(46000:end) = 0;
cr_23 = 18*10^3*(t_hl-0.46);
cr_23(1:46000) = 0;
cr_23(48000:end) = 0;
cr_24 = 18*10^3*(t_hl-0.48);
cr_24(1:48000) = 0;


cr_angle = cr_0+cr_1+cr_2+cr_3+cr_4+cr_5+cr_6+cr_7+cr_8+cr_9+cr_10+cr_11+cr_12+cr_13+cr_14+cr_15+cr_16+cr_17+cr_18+cr_19+cr_20+cr_21+cr_22+cr_23+cr_24;


figure()
plot(t_hl, cr_angle)
        xlim([0 0.50])
        title('Crankagle plotted over time')
        xlabel('time [s]')
        ylabel('\phi [degrees]')